Test modules
Test modules#
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
/tmp/ipykernel_1936/4071232391.py in <module>
----> 1 import altair as alt
2 from vega_datasets import data
3
4 source = data.population.url
5
ModuleNotFoundError: No module named 'altair'
import ipyvolume.datasets
stream = ipyvolume.datasets.animated_stream.fetch()
# print("shape of steam data", stream.data.shape) # first dimension contains x, y, z, vx, vy, vz, then time, then particle
fig = ipv.figure()
# instead of doing x=stream.data[0], y=stream.data[1], ... vz=stream.data[5], use *stream.data
# limit to 50 timesteps to avoid having a huge notebook
q = ipv.quiver(*stream.data[:,0:50,:200], color="red", size=7)
ipv.style.use("dark") # looks better
ipv.animation_control(q, interval=200)
ipv.show()